<#include "../common/layout.ftl"/>
<@layout>
<div class="well">
	<span class="label label-success">修改规则名称</span>
	<form id="form1" class="well form-horizontal" action="/pricerule/update"  method="post">
	  <input name="telPriceRule.id"  type="hidden" value="${telPriceRule.id}" >
	  
	  <table  class="control-group">
	     <tr>
	        <td><label class="control-label" for="focusedInput">名称：</label></td>
	        <td><input class="input-xlarge focused" name="telPriceRule.name" id="name" type="text"  style="height: 26" value="${telPriceRule.name!""}" ></td>
	     </tr>
	     <tr>
	        <td><label class="control-label" for="focusedInput">所属公司：</label></td>
	        <td>
	            <input type='hidden' id="hidcompany" value="${telPriceRule.company!""}"/>
	            <select id="company" name="telPriceRule.company">
                </select>
	        </td>
	     </tr>
      </table>
      <div class="form-actions">
        <button type="submit" class="btn btn-primary">确 定</button>
        <button type="reset" class="btn">重 置</button>
        <button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
      </div>
  </form>
  </div>
<script>
	$(function() { 
		$.ajax({
		    type:'POST',
		    url:"/driver/listLicensenum",
		    dataType:"json",
		    success:function(result){
		    	$(result.record).each(function(){
		    		var selected = "";
		    		if($(this).attr('company') == $("#hidcompany").val()){
		    			selected = "selected";
		    		}
		    		var option = "<option value='"+$(this).attr('company')+"' "+selected+">"+$(this).attr('companyname')+"</option>";
		    		$("#company").append(option);
		    	});
		    },error:function(result){
		    	//alert(result);
		    }
		});
 }); 
</script>
</@layout>